<?php
defined('IN_XLP') or exit('Access Denied');
$Document = array(
    'pageid'   => 'member-index', //页面标示
    'pagename' => '会员列表', //当前页面名称
    'mycss'    => array('../jquery-ui/css/smoothness/jquery-ui-1.10.0.custom.min', 'content/order_table'), //加载的css样式表
    'myjs'     => array(), //加载的js脚本
    'footerjs' => array('content/jquery.smoothConfirm'),
    'head'     => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
    <!-- main padder -->
    <section class="main padder">

        <div class="clearfix">
            <h4><i class="fa fa-table"></i>会员管理</h4>
        </div>

        <section class="panel">
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-12">
                        <section class="panel">
                            <header class="panel-heading">搜索条件</header>
                            <div class="panel-body">
                                <div class="row text-small">
                                    <form action="<?php echo U('member/index'); ?>" method="get">
                                        <div class="col-sm-3">
                                            <div class="input-group">
                                                <input type="text" class="input-sm form-control" placeholder="手机号" name="keyword" value="<?php echo $keyword; ?>">
                                                <span class="input-group-btn">
                                                    <button class="btn btn-sm btn-primary" type="submit">搜索</button>
                                                </span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped b-t text-small"> 
                                      <thead>
                                        <tr>
                                          <th align="center">UID</th>
                                          <th align="center">手机账号</th>
                                          <th align="center">用户等级</th>
                                          <th align="center">状态</th>
                                          <th align="center">注册时间</th>
                                          <th align="center" width="110">操作</th>
                                        </tr>
                                      </thead>
                                      <tbody>
                                      <?php
                                      if ($rs){
                                          foreach($rs as $val){
                                      ?>
                                        <tr id="list_detail_<?php echo $val['uid'];?>">
                                          <td align="center"><?php echo $val['uid'];?></td>
                                          <td align="center"><a><?php echo $val['phone'];?></a></td>
                                          <td align="center" style="color:red;"><?php echo $vip[$val['user_level']] ?></td>
                                          <td align="center"><?php echo $val['status'] == 1 ? '<b style="color:green">正常</b>':'<b style="color:red">冻结</b>'?></td>
                                          <td align="center"><a><?php echo outTime($val['reg_time'] , 4);?></a></td>
                                          <td align="center">
                                              <a href="<?php echo U('member/edit',array('uid'=>$val['uid']));?>">设置会员</a>
                                            <!-- <div class="btn-group"> 
                                                <button class="btn btn-white btn-xs dropdown-toggle" data-toggle="dropdown">操作<span class="caret"></span></button> 
                                                <ul class="dropdown-menu">
                                                    <li>
                                                      <a href="javascript:;" class="set-user" rel="<?php echo $val['uid'];?>">设置会员</a>
                                                    </li>
                                                    <li class="divider"></li>
                                                    <li>
                                                        <a href="javascript:;" rel="<?php echo $val['uid'];?>" class="delete">
                                                            <span class="red">删除会员</span>
                                                        </a>
                                                    </li>
                                                </ul> 
                                            </div> -->
                                          </td>
                                    </tr>
                                    <?php
                                          }
                                      }else{
                                    ?>
                                       <tr>
                                          <td colspan="20" align="center">暂无数据</td>
                                        </tr>
                                    <?php
                                      }
                                    ?>
                                      </tbody>
                                </table> 
                            </div>
                            <footer class="panel-footer">
                                <div class="row">
                                    <div class="col-sm-12 text-right text-center-sm">
                                        <?php echo page($total,$p,'',20,'p');?>
                                    </div>
                                </div>
                            </footer>

                        </section>
                    </div>
                </div>

            </div>

        </section>

    </section>
    <!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
$(function(){
    $('.delete').click(function(){
        var id=$(this).attr('rel');
        $(this).smoothConfirm("确认删除该会员吗？", {
            ok: function() {
                $.post('<?php echo U('member/delete');?>',{"id":id},function(result){
                      $("#list_detail_"+id).fadeOut();
                },'json');
            },
            cancel: function() {
                return false;
            }
      });
      $("body").click();//取消弹出层对对话框的遮蔽
      return false;
    })
});
</script>
<?php include getTpl('footer', 'public'); ?>